<?php

class sendMail{
    
    function cambio_correo($new_mail){
        include_once 'mailer/mailer.php';
        $mail = new Mailer_g2u();
        
        $recipient = $new_mail;
        $subjet = "Cambio de Correo";
        $text = "Ha cambiado su correo";

        ob_start();
        include('mailer/templates/change_mail.php');
        $html = ob_get_contents();
        ob_end_clean();
        $html = preg_replace('/\\\\/','', $html);
        
        $mail->enviarMail($recipient, $subjet, $text, $html);
    }
    
    function confirmacion_cambio_correo($new_mail){
        include_once 'mailer/mailer.php';
        $mail = new Mailer_g2u();
        
        $recipient = $new_mail;
        $subjet = utf8_decode("Confirmación Cambio de Correo");
        $text = "Ha cambiado su correo";

        ob_start();
        include('mailer/templates/change_mail_ok.php');
        $html = ob_get_contents();
        ob_end_clean();
        $html = preg_replace('/\\\\/','', $html);
        
        $mail->enviarMail($recipient, $subjet, $text, $html);
    }    
    
    function confirmacion_nuevo_usuario($new_mail){
        include_once 'mailer/mailer.php';
        $mail = new Mailer_g2u();
        
        $recipient = $new_mail;
        $subjet = utf8_decode("Confirmación de Creación de Cuenta en Gift 2 You");
        $text = "Ha creado su cuenta en G2U.";

        ob_start();
        include('mailer/templates/new_user.php');
        $html = ob_get_contents();
        ob_end_clean();
        $html = preg_replace('/\\\\/','', $html);
        
        $mail->enviarMail($recipient, $subjet, $text, $html);
    }    
}
?>
